#ifndef PERMISSIONBITSCHOSEMENU_H
#define PERMISSIONBITSCHOSEMENU_H

#include <QDialog>
#include <QHash>
#include <QRadioButton>
#include <QCheckBox>

#include "User.h"

#define MAP_DEBUG 0

namespace Ui {
class PermissionBitsChoseMenu;
}

class PermissionBitsChoseMenu : public QDialog
{
    Q_OBJECT

public:
    explicit PermissionBitsChoseMenu(QWidget *parent = nullptr);
    explicit PermissionBitsChoseMenu(Role role, PB_t permissionBit, QWidget* parent = nullptr);
    ~PermissionBitsChoseMenu();

    void initMenu(void);
    void initPermissionMappings(void);

    void initCheckBox();
    void checkBoxDispose();

signals:
    void dataConfirmed(PB_t returnBits);
private:
    Ui::PermissionBitsChoseMenu *ui;

    QHash<Role,QHash<QCheckBox*,UPBits>> m_checkBoxMap;
    QHash<Role,QHash<UPBits,QCheckBox*>> m_reCheckBoxMap;

    Role m_currentRole;
    PB_t m_currentPBits;

    int m_bitsCount;
};

#endif // PERMISSIONBITSCHOSEMENU_H
